Repository navigation
fix(zapier): Read every page of the project list, and bound each list loop - #45
Merged
Merged
Conversation
… loop
The project dropdown (get_all_projects) sets canPaginate, but it ignored
bundle.meta.page. Each "Load more" sent GET /me/projects with no page
parameter, so it showed the first 100 projects again. A user with more than
100 projects never saw the rest.
- get_all_projects sends page and limit to GET /me/projects. For a folder,
GET /folders/{folderId}/projects takes no page parameter, so a later page
returns no rows.
- get_all_agents, get_all_project_templates and get_all_assignable_members
page the same way. Templates and members showed only the 20 rows of the
default page before.
- find_project reads every page of GET /me/projects before it matches.
- Each Zapier list reads at most 20 pages (MAX_PAGES in src/client.ts).
- The n8n list helpers read at most 100 pages. Before, a response that
ignored page or after made Return All and two dropdowns loop forever.
Trigger keys, action keys, input fields and samples do not change.
There was a problem hiding this comment.
🟡 Changes recommended
The pagination guard limits requests but still appends repeated pages, causing duplicate project results when the API ignores the page parameter.
1 open issue
What changed in this PR
This pull request fixes pagination across the Zapier and n8n Taskade integrations so larger collections can load completely while malformed API responses cannot cause unbounded request loops.
Changes:
- Adds page and limit handling for Zapier project, agent, template, and member dropdowns.
- Updates project search to read multiple pages with a 20-page limit.
- Bounds n8n cursor- and page-based list helpers at 100 pages.
- Adds pagination regression tests and changelog entries.
| File | Description |
|---|---|
| src/triggers/getAllProjectTemplates.ts | Adds paginated retrieval for project-template dropdown results. |
| src/triggers/getAllProjects.ts | Reads requested project pages and prevents repeated folder results. |
| src/triggers/getAllAssignableMembers.ts | Adds paginated retrieval for project-member dropdown results. |
| src/triggers/getAllAgents.ts | Adds paginated retrieval for agent dropdown results. |
| src/test/pagination.test.ts | Adds Zapier pagination and page-bound regression tests. |
| src/searches/findProject.ts | Searches across multiple account-level project pages. |
| src/client.ts | Adds shared pagination parameters, page bounds, and bounded multi-page request helpers. |
| packages/n8n-nodes-taskade/test/Taskade.node.test.ts | Adds tests covering n8n pagination bounds. |
| packages/n8n-nodes-taskade/nodes/Taskade/GenericFunctions.ts | Bounds n8n cursor- and page-based list loops. |
| packages/n8n-nodes-taskade/CHANGELOG.md | Documents the n8n pagination safety-bound changes. |
| CHANGELOG.md | Documents the Zapier pagination fixes. |
Review effort: Lite
Comment on lines
+72
to
+80
| const items: Array<Record<string, unknown>> = []; | ||
| for (let page = 1; page <= MAX_PAGES; page++) { | ||
| const response = await request(z, bundle, { | ||
| method: 'GET', | ||
| path, | ||
| params: { limit: String(PAGE_SIZE), page: String(page) }, | ||
| }); | ||
| const pageItems = parseOk(z, response.json).items ?? []; | ||
| items.push(...pageItems); |
Member
Author
|
@deanzaka impact and QA notes for this PR. Impact
No trigger key, action key, input field or sample changes. Release: the Zapier fix is in 1.3.1 in Before and afterHow to QA
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The bug
get_all_projects(src/triggers/getAllProjects.ts) setscanPaginate: true, butperformnever readbundle.meta.page. With no folder selected, it calledGET /api/v1/me/projectswith nopageand nolimit.The public API reference gives that endpoint two query parameters:
limit(default 100) andpage(default 1). So the first request returned projects 1 to 100. When the user clicked "Load more", Zapier sentbundle.meta.page = 1, and the app sent the same request again.Failing input: a user with 150 projects and an empty Workspace or Folder field. "Load more" shows projects 1 to 100 again. Projects 101 to 150 never show.
The fix
get_all_projectsturnsbundle.meta.page(0 for the first page) intopage(1 for the first page) and sendslimit=100.GET /folders/{folderId}/projectstakes no page parameter. A later page now returns no rows, so "Load more" does not repeat the list.dropdownPageParamsreturns no request at page 20 and after (MAX_PAGESinsrc/client.ts). A response that ignorespagecannot make the dropdown load the same rows forever.The same bug in other list calls
get_all_agentsGET /folders/{folderId}/agents(page, limit)canPaginateget_all_project_templatesGET /folders/{folderId}/project-templates(page, limit, default 20)canPaginateget_all_assignable_membersGET /projects/{projectId}/members(page, limit, default 20)canPaginatefind_projectGET /me/projectstaskadeApiRequestPagedItemsandtaskadeApiRequestCursorItemsThe n8n helpers stop at a short page. But with no
limit(Return All, the member dropdown and the template dropdown), a response that ignoredpageoraftermade them loop forever. The new tests show this with a fake API that throws after 1,000 requests.Not changed, because the fix has a different shape:
get_all_tasks,find_taskandget_all_blocksread the first 100 rows of a cursor list (after). A Zapier dropdown needsz.cursorto page a cursor list.get_all_spacesalready pages withbundle.meta.page, and its endpoints take no page parameter.response.limit.No trigger key, action key, input field or sample changes.
Tests
src/test/pagination.test.ts: 13 tests with a fake API that honourspageandlimit. Before the fix, 12 failed. After the fix, all 42 Zapier tests pass.packages/n8n-nodes-taskade/test/Taskade.node.test.ts: 2 new page bound tests. Before the fix, both failed with "runaway loop: more than 1,000 requests". After the fix, all 51 n8n tests pass.